package com.usermanage.Mapping;

import com.usermanage.beanParam.UserBean;
import com.usermanage.beanParam.UserCenterBean;
import com.usermanage.dataDao.JpaDao;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * Created by  on 2018/9/3
 */
@Repository("userCenterMapping")
public interface UserCenterMapping extends JpaRepository<UserCenterBean, Integer> {
    /**
     * 通过openID查询是否存在绑定用户
     * @param openId
     * @return
     */

    @Query(value = "SELECT * from u_user_center WHERE user_wx_id = :openId",nativeQuery = true)
    List<Map> findByOpenId(@Param("openId") String openId);
}
